package com.landinfo.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * 巡护记录
 * Create by lzq
 * 2017-06-06
 */
@ApiModel(description = "巡护记录 Create by lzq 2017-06-06")
@Entity
@Table(name = "patrol_record")
public class PatrolRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
    @SequenceGenerator(name = "sequenceGenerator")
    private Long id;

    /**
     * 巡护设备
     */
    @ApiModelProperty(value = "巡护设备")
    @Column(name = "patrol_device")
    private String patrolDevice;

    /**
     * 巡护人员
     */
    @ApiModelProperty(value = "巡护人员")
    @Column(name = "patrol_person")
    private String patrolPerson;

    /**
     * 巡护方式
     */
    @ApiModelProperty(value = "巡护方式")
    @Column(name = "patrol_style")
    private String patrolStyle;

    /**
     * 巡护路线
     */
    @ApiModelProperty(value = "巡护路线")
    @Column(name = "patrol_path")
    private String patrolPath;

    /**
     * 开始时间
     */
    @ApiModelProperty(value = "开始时间")
    @Column(name = "start_date")
    private ZonedDateTime startDate;

    /**
     * 工作时间
     */
    @ApiModelProperty(value = "工作时间")
    @Column(name = "end_date")
    private String endDate;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Column(name = "remark")
    private String remark;

    /**
     * 行走距离
     */
    @ApiModelProperty(value = "行走距离")
    @Column(name = "patrol_distance")
    private Double patrolDistance;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_date")
    private ZonedDateTime createDate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPatrolDevice() {
        return patrolDevice;
    }

    public PatrolRecord patrolDevice(String patrolDevice) {
        this.patrolDevice = patrolDevice;
        return this;
    }

    public void setPatrolDevice(String patrolDevice) {
        this.patrolDevice = patrolDevice;
    }

    public String getPatrolPerson() {
        return patrolPerson;
    }

    public PatrolRecord patrolPerson(String patrolPerson) {
        this.patrolPerson = patrolPerson;
        return this;
    }

    public void setPatrolPerson(String patrolPerson) {
        this.patrolPerson = patrolPerson;
    }

    public String getPatrolStyle() {
        return patrolStyle;
    }

    public PatrolRecord patrolStyle(String patrolStyle) {
        this.patrolStyle = patrolStyle;
        return this;
    }

    public void setPatrolStyle(String patrolStyle) {
        this.patrolStyle = patrolStyle;
    }

    public String getPatrolPath() {
        return patrolPath;
    }

    public PatrolRecord patrolPath(String patrolPath) {
        this.patrolPath = patrolPath;
        return this;
    }

    public void setPatrolPath(String patrolPath) {
        this.patrolPath = patrolPath;
    }

    public ZonedDateTime getStartDate() {
        return startDate;
    }

    public PatrolRecord startDate(ZonedDateTime startDate) {
        this.startDate = startDate;
        return this;
    }

    public void setStartDate(ZonedDateTime startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public PatrolRecord endDate(String endDate) {
        this.endDate = endDate;
        return this;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getRemark() {
        return remark;
    }

    public PatrolRecord remark(String remark) {
        this.remark = remark;
        return this;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Double getPatrolDistance() {
        return patrolDistance;
    }

    public PatrolRecord patrolDistance(Double patrolDistance) {
        this.patrolDistance = patrolDistance;
        return this;
    }

    public void setPatrolDistance(Double patrolDistance) {
        this.patrolDistance = patrolDistance;
    }

    public ZonedDateTime getCreateDate() {
        return createDate;
    }

    public PatrolRecord createDate(ZonedDateTime createDate) {
        this.createDate = createDate;
        return this;
    }

    public void setCreateDate(ZonedDateTime createDate) {
        this.createDate = createDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PatrolRecord patrolRecord = (PatrolRecord) o;
        if (patrolRecord.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), patrolRecord.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "PatrolRecord{" +
            "id=" + getId() +
            ", patrolDevice='" + getPatrolDevice() + "'" +
            ", patrolPerson='" + getPatrolPerson() + "'" +
            ", patrolStyle='" + getPatrolStyle() + "'" +
            ", patrolPath='" + getPatrolPath() + "'" +
            ", startDate='" + getStartDate() + "'" +
            ", endDate='" + getEndDate() + "'" +
            ", remark='" + getRemark() + "'" +
            ", patrolDistance='" + getPatrolDistance() + "'" +
            ", createDate='" + getCreateDate() + "'" +
            "}";
    }
}
